<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.hzqy.commons.utils.ConstantUtils" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>修改模版</title>
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
	<script type="text/javascript" charset="utf-8" src="../../static/js/Base64.js"></script>
	<script type="text/javascript" charset="utf-8" src="../../static/js/beforeData.js"></script>

<!-- <link href="css/tscss.css" rel="stylesheet" type="text/css" /> 
<link href="css/smsstyle.css" rel="stylesheet" type="text/css" />
<link href="css/bmasdo2.css" rel="stylesheet" type="text/css" />
  -->
<script src="../../static/js/jquery.uploadify.js" type="text/javascript"></script>
<link href="../../static/css/uploadify.css" rel="stylesheet" type="text/css"/>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
	String f_vct_id = request.getParameter("f_vct_id");
	String f_vct_channelid = "1";//request.getParameter("f_vct_channelid");
	String f_vct_customid =  "2";//request.getParameter("f_vct_customid");
	String []nonceObj=ConstantUtils.getNonceObject();
%>
<script type="text/javascript">
	document.onkeydown = function(event) {
		var e = event || window.event || arguments.callee.caller.arguments[0];
		if (e && e.keyCode == 13) { // enter 键
			try {
				searchData();
			} catch (e) {
				gotoSearch($('#easyui-treegrid'));
			}
		}
	};
</script>
<style type="text/css">
.imgsw {
	background: url(../resource/images/a0133.png) no-repeat;
	height: 14px;
	width: 17px;
	display: inline-block;
	border: 0;
}
.OperateTitle
{
	font-size:16px;
    height: 36px;
    background: url(images/labelbg.gif);
}
.td_class
{
    color: #666666;
    font-family: Arial, Helvetica, sans-serif;
}
</style>
<script type="text/javascript">
	$(function() {
		$("#ff").validate({
			rules: {
				f_vct_name: {
					required: true,
					maxlength: 255
				},
				f_vct_desc: {
					maxlength: 2000
				}
			},
			messages: {
				f_vct_name: {
					required: "请输入名称",
					maxlength: "名称不能超过255位"
				},
				f_vct_desc: {
					required: "不能超过2000位"
				}
			}
		});
	});
	
	function submitForm() {
		if($("#ff").validate().form()) {
		app_ajax('../../virtual_channel/update_template.do', $("#ff").serialize(), function(data) {
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						/* parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
						 */
						backForm();
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
		});
	  }
	}
	function clearForm() {
		$('#ff').form('clear');
	}
	function backForm() {
		clearForm();
		history.go(-1);
	}
	$(function() {
		var f_vct_id = <%=f_vct_id%>;
		$.ajax({
			url:"../../virtual_channel/select_template.do?f_vct_id="+f_vct_id,
			success:function(data) {
				data = JSON.parse(data);
				$("#f_vct_id").val(data.f_vct_id);
				$("#f_vct_channelid").val(data.f_vct_channelid);
				$("#f_vct_name").val(data.f_vct_name);
				$("#f_vct_customid").val(data.f_vct_customid);
				$("#f_vct_desc").val(data.f_vct_desc);
				beforeData(data, f_vct_id, "", "../../beforeData.do");
			}
	    });
	}); 
</script>
</head>
<body >
        <table width="100%" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td height="25" valign="middle" align="center" class="OperateTitle td_class">添加模版</td>
			</tr>
		</table>
		<div class="easyui-panel" id="fentable" title="">

			<div style="padding: 10px 0 10px 60px">
				<div id="container">
					<div class="editspace">
						<form id="ff" class="cmxform" method="post" name="formName" enctype="multipart/form-data">
							<input id="f_vct_id" name="f_vct_id" value="" class="yl_inp yw_name" type="hidden" />
							<input id="f_vct_channelid" name="f_vct_channelid" value="" class="yl_inp yw_name" type="hidden" />
							<input id="f_vct_customid" name="f_vct_customid" value="" class="yl_inp yw_name" type="hidden" />
								
							<legend>表单内容</legend>
							<fieldset>
								<div class="fitem">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="50%"><label class="text_right vertop"><span class="red">*</span>模板名称：</label> 
											<input id="f_vct_name" name="f_vct_name" value="" class="yl_inp yw_name" data-options="required:true" /> 
											<span id="projectnameTip" class="tip"></span></td>
										</tr>
									</table>
								</div>
							</fieldset>
							<fieldset>
								<div class="fitem">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="50%"><label class="text_right vertop">说明：</label>
												<textarea name="f_vct_desc" id="f_vct_desc" cols="80" rows="5"></textarea>
												<span id="bindIpTip" class="tip"></span></td>
										</tr>
									</table>
								</div>
							</fieldset>
							<input type="hidden" name="stime" value="<%=nonceObj[0]%>"/>
							<input type="hidden" name="sign" value="<%=nonceObj[1]%>"/>
				
						</form>
					</div>
				</div>
			</div>
			
			<div style="text-align: center; padding: 5px">
			
				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="backForm()">取消</a>
			</div>

		</div>
</body>
</html>
